import request from '@/utils/request'

// 查询工作流实例列表
export function listWorkflowInstance(query) {
  return request({
    url: '/system/workflowInstance/list',
    method: 'get',
    params: query
  })
}

// 查询工作流实例详细
export function getWorkflowInstance(instanceId) {
  return request({
    url: '/system/workflowInstance/' + instanceId,
    method: 'get'
  })
}

// 新增工作流实例
export function addWorkflowInstance(data) {
  return request({
    url: '/system/workflowInstance',
    method: 'post',
    data: data
  })
}

// 修改工作流实例
export function updateWorkflowInstance(data) {
  return request({
    url: '/system/workflowInstance',
    method: 'put',
    data: data
  })
}

// 删除工作流实例
export function delWorkflowInstance(instanceId) {
  return request({
    url: '/system/workflowInstance/' + instanceId,
    method: 'delete'
  })
}

// 执行工作流节点
export function executeNode(instanceId, nodeId) {
  return request({
    url: '/system/workflowInstance/execute/' + instanceId + '/' + nodeId,
    method: 'post'
  })
}

// 导出工作流实例
export function exportWorkflowInstance(query) {
  return request({
    url: '/system/workflowInstance/export',
    method: 'post',
    data: query
  })
} 